<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Adinop Co., Ltd. was founded as an ingredients importer and local manufacturers’ distributor in 1986. We also function as an exporter of finished products</title>
       <link rel="stylesheet" href="../css/style.css"/>
    </head>
    <body> 
        <div align="right">
            <a href="home.php?url=addListCom">
                <img src="../images/computer_add.png" width="40px" >
                                </a>
             <a href="home.php?url=addListCom">
                 <img src="../images/print_empty.png" width="45px">
                                </a>
        </div>
        <?php include_once "../connect.php"; ?>
        <?php
        $sql = "SELECT * FROM comname ORDER BY cn_createdate DESC;";
        $rs = mysql_query($sql);
        $n = 1;
        ?>

        <?php if ($rs): ?>
            <table border="1px" align="center">
                <thead>
                    <tr align="center">
                        <td width="40px">ลำดับ</td>
                        <td width="150px">รหัสเครื่อง</td>
                        <td width="200px">ชื่อเครื่อง</td>
                        <td width="200px">แผนกฝ่าย</td>
                        <td width="150px">IP NO.</td>
                        <td width="200px">ผู้จัดทำ</td>
                        <td width="100px">แก้ไข</td>
                        <td width="100px">ลบ</td>
                    </tr>
                </thead>
                <tbody>
                    <?php while ($r = mysql_fetch_array($rs)): ?>
                        <tr>
                            <td align="center">
                                <?php echo $n++; ?>
                            </td>
                            <td align="center">
                                <?php echo $r["cn_number"]; ?>
                            </td>
                            <td align="center">
                                <?php echo $r["cn_comeName"]; ?>
                            </td>
                            <td align="center">
                                <?php echo $r["de_name"]; ?>
                            </td>
                            <td align="center">
                                <?php echo $r["cn_ip"]; ?>
                            </td>
                            <td align="center">
                                <?php echo $r["cn_createName"]; ?>
                            </td>
                            <td align="center">
                                <a href="home.php?url=addListCom&cn_id=<?= $r[cn_id] ?>">
                                    <img src="../images/write.png" width="35px" >
                                </a>
                            </td>
                            <td align="center">
                                <a href="home.php?url=listCom_delete&id=<?= $r[cn_id] ?>" onclick="return confirm('what do you want Delete')">
                                    <img src="../images/deletered.png" width="35px" >
                                </a>
                            </td>
                        </tr>
                    <?php endwhile ?>
                </tbody>
            </table>
        <?php endif
        ?>
    </body>
</html>